const express = require('express');
const router = express.Router();
const controller = require('../controllers/groupsController');

router.get('/', controller.getAllGroups);
router.get('/enabled', controller.getEnabledGroups);
router.get('/search', controller.searchGroups);
router.get('/:id', controller.getGroupById);
router.post('/', controller.createGroup);
router.put('/:id', controller.updateGroup);
router.delete('/:id', controller.deleteGroup);

// 分组启用/禁用相关接口
router.put('/:id/enable', controller.enableGroup);
router.put('/:id/disable', controller.disableGroup);
router.put('/:id/toggle', controller.toggleGroupStatus);

module.exports = router;